package com.rc.saas.tenant.service.msg;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.msg.TenantReceiveMapper;
import com.rc.saas.tenant.model.msg.TenantReceive;
import com.rc.saas.tenant.search.msg.TenantReceiveSearch;
import com.rc.saas.tenant.vo.msg.TenantCustomMsgResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TenantReceiveServiceImpl implements TenantReceiveService {
    @Autowired
    private TenantReceiveMapper tenantReceiveMapper;

    @Override
    public TenantReceiveMapper getMapper() {
        return tenantReceiveMapper;
    }

    @Override
    public PageInfo<TenantReceive> pageTenantNotice(TenantReceiveSearch search) {
        PageHelper.startPage(search.getOffset(), search.getLimit());
        List<TenantReceive> tenantReceives = tenantReceiveMapper.searchByCondition(search);
        return new PageInfo<TenantReceive>(tenantReceives);
    }
}
